﻿using System;
using System.Web;
using System.Text.RegularExpressions;
/// <summary>
///URL 的摘要说明
/// </summary>
/// 

// http://localhost:8080/#/main
// http://www.leixiaohua.icu/#/main
public class URL
{
    public URL()
    {
    }

    static public string getDomain(string url)
    {
        return Regex.Match(url, @"//\w+(:\d+)*").Value.Replace(@"//", "");
    }

    static public string getDomainSuf(string url)
    {
        return Regex.Match(url, @"//\w+").Value.Replace(@"//", "");
    }

    static public string getDomainName(string url)
    {
        return Regex.Match(url, @"//(\w|\.)+").Value.Replace(@"//", "");
    }
}